#ifndef __UCOSIIFILE_H__
#define __UCOSIIFILE_H__

//#include "string.h"
#include "eclr.h"
#include "log.h"

class GenericFile
{
    public:
    //GenericFile();
    //virtual ~GenericFile();

    enum OpenFlags
    { 
        Open_r = 1,     // open for reading only
        Open_w = 2,     // open for writing only
        Open_rw = 3,    // open for reading and writing
        Open_c = 4      // create file (if existing, it will be deleted and created new
    };

    enum SeekModes
    { 
        Seek_cur = 1,     // seek from current position
        Seek_set = 2      // seek from begin
    };

    static int open(const char* fname , enum OpenFlags mode);
    static int remove(const char* fname);
    static int close(int fh);
    static int read(int fh, void* buffer, unsigned int size);
    static int write(int fh, void* buffer, unsigned int size);
    static long seek(int fh, long offset, enum SeekModes mode);
};

#endif //#define __UCOSIIFILE_H__
